package com.api.dispose.base;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.apache.commons.lang3.StringUtils;

import com.api.entity.RequestParams;

public class BaseDispose {
	/**
	 * 把参数封装成 map
	 * @param list
	 * @return
	 */
	public  Map<String, String> disposeRequest(List<RequestParams> list){
		if(list==null || list.size()<=0){
			return null;
		}
		Map<String, String> map = new HashMap<String, String>();
		for (int i = 0; i < list.size(); i++) {
			RequestParams data = list.get(i);
			//优化请求参数，去除为空值的参数
			if (StringUtils.isNotEmpty(data.getName()) && StringUtils.isNotEmpty(data.getVal())) {
				map.put(data.getName(), data.getVal());
			}
		}
		return map;
	}
	public  String disposeResponse(String responseStr){
		return responseStr;
	}
}
